<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>显示隐藏文本框内容</title>
</head>
<body>
    <input type="text" id="myInput" value="请输入内容" />
    <script>
    const input = document.getElementById('myInput');
    const testArea = document.getElementById('testArea');
    input.onfocus = function () {
        if (this.value === '请输入内容') {
            this.value = '';
        }
    };
    input.onblur = function () {
        if (this.value === '') {
            this.value = '请输入内容';
        }
    };
    testArea.onclick = function(){
        if (input.value === '') {
            input.value = '请输入内容';
        }
    };
    </script>
</body>
</html>